package com.companyName.sample.service.business;

import com.companyName.sample.common.util.PageInfo;
import com.companyName.sample.data.entity.SysLogPo;
import com.companyName.sample.data.mapper.SysLogMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * Created by guo.jun on 2016/4/11.
 */
@Component
public class LogBiz {
    private static final Logger logger = LoggerFactory.getLogger(LogBiz.class);
    @Autowired
    private SysLogMapper sysLogMapper;
    /**
     * 登录日志
     */
    public void loginInsertLog(SysLogPo sysLogPo) {
        sysLogMapper.insert(sysLogPo);
    }

    /**
     * 登录数据
     */
    public void loginFindDataGrid(PageInfo pageInfo) {
        pageInfo.setRows(sysLogMapper.findDataGrid(pageInfo));
        pageInfo.setTotal(sysLogMapper.findDataGridCount(pageInfo));
    }

}
